home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
emula
/
arosdv19.lha
/
AROS
/
config
/
i386-emul
/
stackswap.s
< prev
next >
Wrap
Text File
|
1996-10-24
|
2KB
|
95 lines
# (C) 1995-96 AROS - The Amiga Replacement OS
# $Id: stackswap.s,v 1.7 1996/10/24 15:51:12 aros Exp $
# $Log: stackswap.s,v $
# Revision 1.7 1996/10/24 15:51:12 aros
# Use the official AROS macros over the __AROS versions.
#
# Revision 1.6 1996/10/23 08:04:26 aros
# Use generated offsets which makes porting much easier
#
# Revision 1.5 1996/09/11 16:54:29 digulla
# Always use __AROS_SLIB_ENTRY() to access shared external symbols, because
# some systems name an external symbol "x" as "_x" and others as "x".
# (The problem arises with assembler symbols which might differ)
#
# Revision 1.4 1996/08/23 16:49:22 digulla
# With some systems, .align 16 aligns to 64K instead of 16bytes. Therefore
# I replaced it with .balign which does what we want.
#
# Revision 1.3 1996/08/13 14:03:20 digulla
# Added standard headers
#
# Revision 1.2 1996/08/01 17:41:20 digulla
# Added standard header for all files
#
# Desc:
# Lang:
#*****************************************************************************
#
# NAME
# AROS_LH0(void, StackSwap,
#
# LOCATION
# struct ExecBase *, SysBase, 122, Exec)
#
# FUNCTION
#
# INPUTS
#
# RESULT
#
# NOTES
#
# EXAMPLE
#
# BUGS
#
# SEE ALSO
#
# INTERNALS
#
# HISTORY
#
#******************************************************************************
.include "machine.i"
.text
.balign 16
.globl _Exec_StackSwap
.type _Exec_StackSwap,@function
_Exec_StackSwap:
movl 4(%esp),%edx
movl 8(%edx),%ecx
popl %eax
movl %eax,-12(%ecx)
popl %eax
movl %eax,-8(%ecx)
movl (%esp),%eax
movl %eax,-4(%ecx)
addl $-12,%ecx
leal Disable(%eax),%eax
call *%eax
popl %eax
movl %esp,8(%edx)
movl %ecx,%esp
movl ThisTask(%eax),%ecx
leal tc_SPLower(%ecx),%ecx
push %ebx
movl (%edx),%eax
movl (%ecx),%ebx
movl %eax,(%ecx)
movl %ebx,(%edx)
movl 4(%edx),%eax
movl 4(%ecx),%ebx
movl %eax,4(%ecx)
movl %ebx,4(%edx)
popl %ebx
movl 8(%esp),%eax
pushl %eax
leal Enable(%eax),%eax
call *%eax
addl $4,%esp
ret